package com.fare.taluo.fetl.domain.entity.history;

import java.util.Date;
import java.util.List;

import com.dayatang.domain.InstanceFactory;
import com.fare.taluo.base.ddd.domain.BaseHBaseEntity;
import com.fare.taluo.fetl.domain.repository.history.IDoublePlaneInfoHistoryRepository;
import com.fare.taluo.vo.core.PlaneInfo;
/**
 * 往返程历史数据表</br>
 * hbase表rowkey= 00002 CAN AKL 20140402 20140409 20140416 000CZ305 00000000 00000000
 * 渠道hbasekey[5位]出发城市三字码[3位]到达城市三字码[3位]抓取时间[8位yyyyMMdd]
 *  去程航班时间[8位yyyyMMdd]返程航班时间[8位yyyyMMdd]航班号[8位，不足则左侧补0]
 *  中转航班号1[8位，不足则左侧补0]中转航班号2[8位，不足则左侧补0]
 *  <p>没有中转时后面全部补0
 * @author xingsf 2014-04-04
 *
 */
public class DoublePlaneInfoHistoryEntity extends BaseHBaseEntity{
	/**
	 * 
	 */
	private static final long serialVersionUID = -3197273050241727093L;

	@Override
	public String generateRowKey() {
		return null;
	}
	public IDoublePlaneInfoHistoryRepository getDoublePlaneInfoHistoryRepository() {
		return InstanceFactory.getInstance(IDoublePlaneInfoHistoryRepository.class);
	}
	/**
	 * 获得历史航班价格数据,航线下的全部航班
	 * @param crawlDate
	 * @param hbaseKey
	 * @param fromCode
	 * @param toCode
	 * @param flightDate
	 * @return
	 * @throws Exception
	 */
	public List<PlaneInfo> find(Date crawlDate, String hbaseKey,
			String fromCode, String toCode, Date flightDate,
			Date returnFlightDate) throws Exception{
		return getDoublePlaneInfoHistoryRepository()
				.find(crawlDate, hbaseKey, fromCode, toCode, flightDate,returnFlightDate);
	}
	/**
	 * 获得历史航班价格数据 ,航线下的指定航班
	 * @param crawlDate
	 * @param hbaseKey
	 * @param fromCode
	 * @param toCode
	 * @param flightDate
	 * @return
	 * @throws Exception
	 */
	public List<PlaneInfo> find(Date crawlDate, String hbaseKey,
			String fromCode, String toCode, Date flightDate, String flightNo,
			Date returnFlightDate) throws Exception{
		return getDoublePlaneInfoHistoryRepository()
				.find(crawlDate, hbaseKey, fromCode, toCode, flightDate,flightNo, returnFlightDate);
	}
}
